function createObj(o) {
    function F() {}
    F.prototype = o;
    return new F();
}

const person = {
    name: 'willem',
    colors: ['red', 'green', 'blue']
};

const p1 = createObj(person);
const p2 = createObj(person);

p1.colors.push('white');
//object.create()为浅拷贝
console.log(p1);
console.log(p2);